home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / Sources / src / lib / rcread.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-27  |  629 b   |  46 lines

  1. /*{{{}}}*/
  2. /*{{{  includes*/
  3. #include <stdio.h>
  4.  
  5. #include <h/keys.h>
  6. #include <h/token.h>
  7. #include <h/rcformat.h>
  8. #include <lib/ori_rc_lib.h>
  9. /*}}}  */
  10.  
  11. /*{{{  rc_get_w*/
  12. int rc_get_w(FILE * const f)
  13. { int val;
  14.   int b1;
  15.  
  16.   b1=getc(f);
  17.   val=((b1&0x7f)<<8)+getc(f);
  18.   return((b1&0x80)?-val:val);
  19. }
  20. /*}}}  */
  21. /*{{{  rc_nget_w*/
  22. void rc_nget_w(FILE * const f,int n,int *t)
  23. {
  24.  
  25.   while (n-->0)
  26.    { int i;
  27.   
  28.      i=rc_get_w(f);
  29.      *t++=i;
  30.    }
  31. }
  32. /*}}}  */
  33. /*{{{  rc_get_s*/
  34. void rc_get_s(FILE * const f,char *s,int l)
  35. {
  36.   int c;
  37.  
  38.   do
  39.    { c=rc_get_c(f);
  40.      if (s)
  41.         *s++=c;
  42.    }
  43.   while (c && c!=EOF && --l);
  44. }
  45. /*}}}  */
  46.